package psmanager.db.types;

public class ConsolePrinter {

	private static final int STR_LENGTH = 40;
	public static void printHeader(String[] names) {
		System.out.println();
		for (String name : names) {
			System.out.print(appendWhiteSpace(name));
		}
		System.out.println();
		for (int i=0; i<STR_LENGTH * names.length; i++) {
			System.out.print("-");
		}
		System.out.println();
	}

	public static void printRow(Object[] values) {
		for (Object value : values) {
			System.out.print(appendWhiteSpace(String.valueOf(value)));
		}
		System.out.println();
	}
	
	private static String appendWhiteSpace(String str){
		StringBuffer stringBuffer = new StringBuffer(str);
		for(int i=0; i< STR_LENGTH -str.length(); i++){
			stringBuffer.append(" ");
		}
		return stringBuffer.toString();
	}


	
}
